<div class="tableToolbar">
    <div class="coll-md-9" id="addInput">
        <div class="coll-md-15">
            <input type="text" class='search' placeholder="后台用户名" ng-model="ctrlScope.itemsearch.sysUserName">
        </div>
        <div class="coll-md-15">
            <input type="text" class='search' placeholder="前台用户名" ng-model="ctrlScope.itemsearch.username">
        </div>
        <div class="coll-md-3 scalenone" id="search2">
            <div class="coll-md-5">
                <input type="text" class='search' placeholder="手机号码" ng-model="ctrlScope.itemsearch.userMobile">
            </div>
            <div class="coll-md-5">
                <input type="text" class='search' placeholder="所属机构" ng-model="ctrlScope.itemsearch.companyName">
            </div>
        </div>
        <div class="coll-md-3 scalenone"  id="searchdate" datahide>
            <div class="coll-md-5" >
                <p class="input-group">
                    <input type="text" class="search" placeholder="开始时间" uib-datepicker-popup="yyyy-MM-dd"
                           ng-model="ctrlScope.itemsearch.beginDateTimex" is-open="popup1.opened" datepicker-options="dateOptions"/>
						<span class="input-group-btn">
							            <button type="button" class="small-icon btn btn-default" ng-click="open1()"><i
                                                class="glyphicon glyphicon-calendar"></i></button>
							          </span>
                </p>
            </div>
            <div class="coll-md-5">
                <p class="input-group inline">
                    <input type="text" class="search" placeholder="结束时间" uib-datepicker-popup="yyyy-MM-dd"
                           ng-model="ctrlScope.itemsearch.endDateTimex" is-open="popup2.opened" datepicker-options="dateOptions"/>
						<span class="input-group-btn">
							            <button type="button" class="small-icon btn btn-default" ng-click="open2()"><i
                                                class="glyphicon glyphicon-calendar"></i></button>
							          </span>
                </p>
            </div>
        </div>
        <div class="coll-md-1">
            <input type="button" class="small-icon search2-icon" value="搜索" ng-click="search()">
            <input type="button" class="small-icon search2" value="搜索">
            <input type="button" class="small-icon reset-icon" reset-icon value="重置" ng-click="reset()">
            <input type="button" class="small-icon reset" value="重置">

            <div class="dropdown-menu-right">
                <input type="button" class="small-icon more-icon" value="更多" title='更多搜索项' id="more-icon" data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false">
                <input type="button" class="small-icon more" value="更多">
                <ul class="dropdown-menu" style='margin-left:80px;' aria-labelledby="dropdownMenu2" more-search>
                    <li><a href="javascript:;">日期搜索</a></li>
                    <li><a href="javascript:;">其他条件搜索</a></li>
                </ul>
            </div>
        </div>
    </div>
    <div class="coll-md-1">
        <input type="button" class="bttn pos-right"  ng-click="addOrderModal()" value="新建">
    </div>
</div>
<table ui-table="orderParams">
    <thead>
    <tr>

        <th>后台用户名</th>
        <th>类型</th>
        <th>前台用户名</th>
        <th>真实姓名</th>
        <th>手机号码</th>
        <th>所属机构</th>
        <th>身份证号</th>
        <th>添加时间</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr ng-repeat="item in orderParams.$rows">
        <td>{{item.sysUserName}}</td>
        <td>{{item.type | sysUserType }}</td>
        <td>{{item.username}}</td>
        <td>{{item.realname}}</td>
        <td>{{item.userMobile}}</td>
        <td>{{item.companyName}}</td>
        <td>{{item.identifyCard}}</td>
        <td>{{item.addtime | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
        <td>
           <!-- <a ng-if='item.realnameStatus==0' ng-click="identify(item.id)">认证</a>
            <a ng-if='item.bankStatus==0' ng-click="card(item.id)">绑卡</a>
            <span ng-if='item.bankStatus==1'>已绑卡</span>-->
            <a ng-click="deleteUser(item.id)">删除</a>
            <a ng-if="item.bindingStatus==0" ng-click="bindingUser(item.id,item.type)">绑定</a>
            <span ng-if="item.bindingStatus==1">已绑定</span>
        </td>
    </tr>
    </tbody>
</table>
<modal title="绑定" visible="bindingModal" draggable>
    <form class="form-horizontal" role="form">
        <div class="form-body">
            <div class="row" >
                <div class="col-md-3">
                    <label class="control-label col-md-12">前台用户：</label>
                </div>
                <div class="col-md-6">
                    <div class="form-group">

                        <div class="col-md-8">
                            <select class="form-control" required ui-select2="selectOptions" ng-model="bind.userId" ng-change="matchMobile(bind.userId)">
                                <option value="" disabled selected hidden>请选择</option>
                                <option ng-repeat="item in usernames" value="{{item.id}}">{{item.username}}{{item.realname}}</option>
                            </select>
                        </div>
                        <div class="col-md-4">

                        </div>
                    </div>
                </div>
            </div>
            <div class="row" >
                <div class="col-md-3">
                    <label class="control-label col-md-12">手机号码：</label>
                </div>
                <div class="col-md-6">
                    <div class="form-group">

                        <div class="col-md-8">
                            <input type="text" class="form-control" ng-model="bind.mobile">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row" >
                <div class="col-md-3">
                    <label class="control-label col-md-12">短信验证码：</label>
                </div>
                <div class="col-md-6">
                    <div class="form-group">

                        <div class="col-md-8">
                            <input type="text" class="form-control" ng-model="bind.mobileCode" placeholder="请填写验证码">
                        </div>
                        <div class="col-md-4">
                            <input type="button" class="bttn" value="{{Verification.getCodeTest}} {{Verification.time}}" ng-click="getCode(bind.userId)" ng-disabled="Verification.isTimeOut" ng-class="{true:'inputDisabled',false:''}[Verification.isTimeOut]">
                        </div>
                    </div>
                </div>

            </div>

            <div class="buttonArea col-md-12">
                <button type="submit" class="btn blue" ng-click="confirm()">确定</button>
            </div>

        </div>
    </form>
</modal>
<modal title="新建" visible="addModal" draggable>
    <form class="form-horizontal" role="form" name="myForm" ng-submit="addSubmit(myForm.$valid)" novalidate>
        <div class="form-body">
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">用户名</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control" ng-model="add.sysUserName" placeholder="用户名" required>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">密码</label>

                        <div class="col-md-8">
                            <input type="text" class="form-control" ng-model="add.password" placeholder="密码" required>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">所属机构</label>
                        <div class="col-md-8">
                            <select class="form-control"  ng-model="add.companyId" ui-select2="selectOptions">
                                <option value="" selected hidden disabled>请选择</option>
                                <option ng-repeat="item in companise"  ng-value="item.id">{{item.name}}</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">类型</label>
                        <div class="col-md-8">
                            <select class="form-control"  ng-model="add.type" ui-select2="selectOptions">
                                <option value="" selected hidden disabled>请选择</option>
                                <option value="1">员工</option>
                                <option value="3">业务员</option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="buttonArea col-md-12">
                <button type="submit" class="btn blue" ng-disabled="myForm.$invalid">提交</button>
            </div>

        </div>
    </form>
</modal >
<modal title="认证" visible="identifyModel">
    <form class="form-horizontal" role="form" name="myForm" ng-submit="identifySubmit(myForm.$valid)" novalidate>
        <div class="form-body">
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">真实姓名</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control" ng-model="add.realname" placeholder="真实姓名" required>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">身份证号码</label>

                        <div class="col-md-8">
                            <input type="text" class="form-control" ng-model="add.IdCard" minlength="15" maxlength="18" placeholder="身份证号码" name='idcard'  ng-pattern="/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/" required>
                            <div class="error" ng-show="myForm.idcard.$error.pattern">
                                请输入正确的身份证号码
                            </div>
                        </div>

                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label col-md-4">借款人类型</label>

                        <div class="col-md-8">
                            <select required ng-model="add.type" class="form-control"
                                    ui-select2="select2Options">
                                <option value="" disabled selected hidden>请选择</option>
                                <option value="2">借款人</option>
                                <option value="6">投资借款人</option>
                            </select>
                        </div>
                    </div>
                </div>

            </div>
            <div class="buttonArea col-md-12">
                <button type="submit" class="btn blue" ng-disabled="myForm.$invalid">提交</button>
            </div>

        </div>
    </form>
</modal>
